﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
using F2S.LINQ2LinkedIn.Model;

namespace F2S.LINQ2LinkedIn.Model
{
    [DebuggerDisplay("Total={Total}")]
    [XmlRoot("connections")]
    [XmlInclude(typeof(Person))]
    public class ConnectionsCollection
    {
        [XmlAttribute(AttributeName = "total")]
        public int Total { get; set; }

        [XmlElement(ElementName = "person")]
        public Person[] Persons { get; set; }

        public override string ToString()
        {
            return string.Format("Total={0}", Total);
        }
    }

    /*
        <connections total="1">
          <person>
            <id>mjXge4pyFd</id>
            <first-name>Chris</first-name>
            <last-name>Partridge</last-name>
            <headline>Unix Systems Administrator at Brocade</headline>
            <picture-url>http://m.c.lnkd.licdn.com/mpr/mprx/0_tpExEq-o4D-jaLdetUS2Enho4SFxuLJerRYhEBi4FI17PTaHOVsPXcB998b8fG4kP0eT5rgJfoNz</picture-url>
            <api-standard-profile-request>
              <url>http://api.linkedin.com/v1/people/mjXge4pyFd</url>
              <headers total="1">
                <http-header>
                  <name>x-li-auth-token</name>
                  <value>name:0PQ2</value>
                </http-header>
              </headers>
            </api-standard-profile-request>
            <site-standard-profile-request>
              <url>http://www.linkedin.com/profile/view?id=16212313&amp;authType=name&amp;authToken=0PQ2&amp;trk=api*a3135321*s3210031*</url>
            </site-standard-profile-request>
          </person>
        </connections>
*/
}
